
// XNA includes.
#include <Riccsson/Xna/Framework/Vector2.h>
#include <Riccsson/Xna/Framework/Vector3.h>
#include <Riccsson/Xna/Framework/RGame.h>
#include <Riccsson/Xna/Framework/GraphicsDeviceManager.h>
#include <Riccsson/Xna/Framework/Graphics/SpriteBatch.h>
#include <Riccsson/Xna/Framework/GameWindow.h>
#include <Riccsson/Xna/Framework/GameTime.h>
#include <Riccsson/Xna/Framework/PlayerIndex.h>
#include <Riccsson/Xna/Framework/Graphics/GraphicsDevice.h>
#include <Riccsson/Xna/Framework/Audio/DynamicSoundEffectInstance.h>

#include <System/String.h>
#include <System/Collections/Generic/List.h>
#include <System/Array.h>
#include <System/Console.h>
#include <System/Text/Encoding.h>
#include <System/IO/FileStream.h>
#include <REvents.h>
#include <System/Generic/EventHandler.h>

#include <Riccsson/Xna/Framework/Input/Touch/TouchLocation.h>
#include <Riccsson/Xna/Framework/Input/Touch/TouchPanel.h>

// DEBUG.
#include "Debug.h"

namespace RiccssonXnaText
{

	/// <summary>
	/// This is the main type for your game
	/// </summary>
	class MaincClass : public Riccsson::Xna::Framework::Game
	{
		GC_PTR<Riccsson::Xna::Framework::GraphicsDeviceManager> graphics;
		GC_PTR<Riccsson::Xna::Framework::Graphics::SpriteBatch> spriteBatch;
		GC_PTR<Riccsson::Xna::Framework::Graphics::Texture2D> aTexture;
		GC_PTR<Riccsson::Xna::Framework::Graphics::Texture2D> aTextureButton;
		GC_PTR<Riccsson::Xna::Framework::Graphics::Texture2D> aTextureButtonPressed;
		GC_PTR<Riccsson::Xna::Framework::Audio::DynamicSoundEffectInstance> soundEngine;
	
		Riccsson::Xna::Framework::Color grey;
		int flow;
		Riccsson::System::Collections::Generic::List<Riccsson::Xna::Framework::Rectangle> m_touchSquares;
		int test;
		float pitch;

		public: MaincClass();

		/// <summary>
		/// Allows the game to perform any initialization it needs to before starting to run.
		/// This is where it can query for any required services and load any non-graphic
		/// related content.  Calling base.Initialize will enumerate through any components
		/// and initialize them as well.
		/// </summary>
		protected: override void Initialize();

		private: Void OnAudioBuffer(Riccsson::System::Object* sender, Riccsson::System::EventArgs args);

		/// <summary>
		/// LoadContent will be called once per game and is the place to load
		/// all of your content.
		/// </summary>
		protected: override void LoadContent();

		/// <summary>
		/// UnloadContent will be called once per game and is the place to unload
		/// all content.
		/// </summary>
		protected: override void UnloadContent();


		/// <summary>
		/// Allows the game to run logic such as updating the world,
		/// checking for collisions, gathering input, and playing audio.
		/// </summary>
		/// <param name="gameTime">Provides a snapshot of timing values.</param>
		protected: override void Update(Riccsson::Xna::Framework::GameTime gameTime);

		/// <summary>
		/// This is called when the game should draw itself.
		/// </summary>
		/// <param name="gameTime">Provides a snapshot of timing values.</param>
		protected: override void Draw(Riccsson::Xna::Framework::GameTime gameTime);
	};
}